


eststo clear
set more off
use Data/event_study_sample_quartsince2006.dta, clear

 

 
	

format quarter %tq
label var quarter "Year-Quarter"
label var year "Year"

merge m:1 postcode using Data/bypostcode.dta, keepusing(above_med* NCustomer_pc quintiles_Relative) // created in Desc_stats_roof





** difference in green power by dwelling suitablity 
reg green_plan i.above_medRelative##i.quarter   [aweight =NCustomer_pc] if year < 2008, cluster(postcode)


margins quarter, dydx(above_medRelative)

est store green_diff
marginsplot,  recastci(rarea) ciopts(color(gs14)) plotopts(color(gs5)   msize(small)) ytitle("Difference in green power (% customers)" , size(large)) title("") ylabel(, labsize(large)) xlabel(, labsize(large)) xtitle("Quarter", size(large))

graph export Analysis/diff_green20062007_quarter.png, replace

graph export Analysis/diff_green20062007_quarter.eps, replace




